package com.wyj.db;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 * Created by WYJ on 2017/6/4.
 */
public class DBConnection {
    private static final String driver = "com.mysql.jdbc.Driver";
    private static final String url = "jdbc:mysql://594d4154139aa.sh.cdb.myqcloud.com:13041/ppb?characterEncoding=utf-8&useSSL=false";
    private static final String username = "cdb_outerroot";
    private static final String password = "kfc12345678";

    public static Connection getConnection(){
        Connection conn=null;
        try {
            Class.forName(driver);
            conn = DriverManager.getConnection(url, username, password);
        }catch (SQLException e){
            e.printStackTrace();
        }catch (ClassNotFoundException e){
            e.printStackTrace();
        }
        return conn;
    }
}
